package com.cow.controller;

import com.cow.entity.Banner;
import com.cow.service.BannerService;
import com.cow.util.general.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/banner")
public class BannerController {

    @Autowired
    private BannerService bannerService;

    @GetMapping("/findAll")
    public CommonResult findAll() {
        List<Banner> list = bannerService.list();
        return CommonResult.success("轮播图查询成功", list);
    }
}
